#include <stdio.h>
int sun=0;
int n,m;

void selve(int x,int y)
{
    if(x==0&&y==0)
    {
        sun++;
        return;
    }
    int dx[]={-1,-1,-2,-2};
    int dy[]={2,-2,1,-1};
    for(int i=0;i<4;i++)
    {
        int nx=x+dx[i];
        int ny=y+dy[i];
        if(nx>=0&&ny>=0&&nx<=n&&ny<=m)
        {
            selve(nx,ny);
        }
    }
}


int main(void) {

    scanf("%d%d",&n,&m);
    selve(n,m);
    printf("%d\n",sun);
    return 0;
}
